package com.orhon.smartcampus.modules.teacher.mm;


import com.orhon.smartcampus.modules.base.mm.DictionaryMapper;
import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.teacher.entity.Award;
import com.orhon.smartcampus.modules.teacher.entity.OfficeArrange;
import com.orhon.smartcampus.modules.teacher.gqlModel.GQLAward;
import com.orhon.smartcampus.modules.teacher.gqlModel.GQLTeacherOffice;
import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(
        uses={
                LangMapper.class,
                DictionaryMapper.class
        }
)
public interface TeacherOfficeMapper {
    TeacherOfficeMapper MAPPER = Mappers.getMapper(TeacherOfficeMapper.class);
    @Mappings({
            @Mapping(source="id",target="id"),
            @Mapping(source="officeName",target="name"),
            @Mapping(source="createdBy",target="created_by"),
            @Mapping(source="updatedBy",target="updated_by"),
            @Mapping(source="createdAt",target="created_at"),
            @Mapping(source="updatedAt",target="updated_at"),
            @Mapping(source="deletedAt",target="deleted_at"),
            @Mapping(ignore = true, target = "buildings" ),
            @Mapping(ignore = true, target = "unit" ),
            @Mapping(ignore = true, target = "floor" ),
            @Mapping(ignore = true, target = "room" ),
            @Mapping(ignore = true, target = "headUser" ),
            @Mapping(ignore = true, target = "department" )

    })
    GQLTeacherOffice mapEntity(OfficeArrange entity);
    
    @InheritConfiguration(name = "mapEntity")
    List<GQLTeacherOffice> mapEntityList(List<OfficeArrange> entities);
}
